/*
 * FileName: DownLoadController.java
 * Author:   zzw
 * Date:     2018年06月23日
 * Description: hbase原始数据
 */
package com.chezhibao.trace.controller;

import com.chezhibao.trace.service.DataService;
import com.chezhibao.trace.vo.Message;
import com.chezhibao.trace.vo.SqlVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 〈hbase原始数据〉<br>
 * 〈〉
 *
 * @author zzw
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本]（可选）
 */
@RestController
public class DownLoadController {

    @Autowired
    private DataService dataService;

    @GetMapping("/trace/download/{traceId}")
    public List<Message> getData(@PathVariable("traceId") String traceId){
        List<Message> date = dataService.getData(traceId);
        return date;
    }

    @GetMapping("/trace/sql/{sqlId}")
    public SqlVo getSql(@PathVariable("sqlId")String sqlId){
        SqlVo sqlVo = dataService.getSqlVo(sqlId);
        return sqlVo;
    }
}
